<template>
    <layout>
        <mt-header :title="title">
            <a href="javascript:window.history.go(-1);" slot="left">
                <mt-button icon="back"></mt-button>
            </a>
        </mt-header>
        <el-tree
            :data="point"
            accordion
            :highlight-current="true"
            @node-click="nodeClick"
            class="filter-tree">

        </el-tree>
    </layout>
</template>
<style lang="scss">
    @import "index.scss";

</style>
<script type="text/babel">
    import { api, image } from 'framework/config.js';
    import Layout from "component/layout/standard";

    import Vue from 'vue'

    import { Tree } from 'element-ui';
    import 'element-ui/lib/theme-chalk/index.css';
    Vue.component(Tree.name, Tree);

    import Mint from 'mint-ui';
    Vue.use(Mint);

    export default {
        components: {
            Layout
        },
        data(){
            return {

            }
        },
        computed: {
            api(){
                return api();
            },
            title(){
                if (this.type == 1){
                    return "专项巩固练习";
                }else if (this.type == 2){
                    return "普遍错题";
                }else{
                    return "专项巩固练习";
                }
            }
        },
        methods: {
            nodeClick(data){
                if (data.children.length == 0){
                    window.location.href = `/study/practice?type=${this.type}&pointId=${data.id}&courseId=${this.courseId}`;
                }
            }
        },
        mounted() {
        }
    }
</script>

